home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
cmln0985.arc
/
TABLES.LTG
< prev
next >
Wrap
Text File
|
1986-02-27
|
3KB
|
109 lines
Logic at a Glance
Listings
Listing 1.
'getl' output from Ergo Logic Compiler
if (!(length == 1)) {
if (!(c == '\n')) {
if (!(c == BACKSPACE)) {
if (i == length ) {
beep();
}
else if (typ == NUMERIC) {
if (isdigit(c)) {
addch(c);
refresh();
str[i] = c ;
str[i+1]='\0';
i++ ;
}
else {
beep();
}
}
else {
addch(c);
refresh();
str[i] = c ;
str[i+1]='\0';
i++ ;
}
}
else if (!(i == 0 )) {
backup(1);
}
else {
beep();
}
}
else {
break;
}
}
else {
addch(c);
refresh();
str[i] = c ;
str[i+1]='\0';
break;
}
è
Listing 2.
'getl' compiled to isolate most frequent rules first
if (!(length == 1)) {
if (!(c == '\n')) {
if (!(c == BACKSPACE)) {
if (!(typ == NUMERIC)) {
if (!(i == length )) {
addch(c);refresh();
str[i] = c ;
str[i+1]='\0';
i++ ;
}
else {
beep();
}
}
else if (!(i == length )) {
if (isdigit(c)) {
addch(c);refresh();
str[i] = c ;
str[i+1]='\0';
i++ ;
}
else {
beep();
}
}
else {
beep();
}
}
else if (!(i == 0 )) {
backup(1);
}
else {
beep();
}
}
else {
break;
}
}
else {
addch(c);refresh();
str[i] = c ;
str[i+1]='\0';
break;
}
è